import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


public class ExpressionGenerator {
    public static void main(String[] args) throws IOException{
        int Snum = Integer.parseInt(args[0]);
        int level = Integer.parseInt(args[1]);
        String file = args[2];
        FileOutputStream fs = new FileOutputStream(new File(file));
        PrintStream p = new PrintStream(fs);

        Set list = new HashSet();

        FileWriter fw = new  FileWriter (file);
        BufferedWriter bw = new BufferedWriter (fw);
        PrintWriter pw = new PrintWriter (bw);

        int List = 1;

        for(int a = 0; a<Snum; a++){
            switch(level) {
                case 1:
                    level1 W = new level1();
                    String input1 = W.getLevel1();
                    if (!input1.contains(W.Level1())) {
                        list.add(W.Level1());
                    }

                    if (list.size() == List) {
                        pw.println(input1 + "= ");
                        List++;
                    } else {
                        a--;
                    }
                    break;

                case 3:
                    level2 E = new level2();
                    String input2 = E.getLevel2();
                    if (!list.contains(E.getLevel2())) {
                        list.add(E.getLevel2());
                    }

                    if (list.size() == List) {
                        pw.println(input2 + "= ");
                        List++;
                    } else {
                        a--;
                    }
                    break;

                case 5:
                    level3 R = new level3();
                    String input3 = R.getLevel3();
                    if (!list.contains(R.getLevel3())) {
                        list.add(R.getLevel3());
                    }

                    if (list.size() == List) {
                        pw.println(input3 + "= ");
                        List++;
                    } else {
                        a--;
                    }
                    break;


                case 7 :
                    level4 Q = new level4();
                    String input4 = Q.getLevel4();
                    if (!list.contains(Q.Level4())) {
                        list.add(Q.Level4());
                    }

                    if (list.size() == List) {
                        pw.println(input4 + "= ");
                        List++;
                    } else {
                        a--;
                    }
                    break;

            }
        }
        pw.close();
    }
}